//
//  XDMeasureLineView.m
//  Measure
//
//  Created by xieyajie on 14-3-5.
//  Copyright (c) 2014年 XDIOS. All rights reserved.
//

#import "XDMeasureLineView.h"

@interface XDMeasureLineView()

@end

@implementation XDMeasureLineView

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        // Initialization code
        self.backgroundColor = [UIColor colorWithWhite:0.5f alpha:0.5];
        
        _referenceView1 = [[UIView alloc] init];
        _referenceView1.backgroundColor = [UIColor redColor];
        [self addSubview:_referenceView1];
        
        _referenceView2 = [[UIView alloc] init];
        _referenceView2.backgroundColor = [UIColor redColor];
        [self addSubview:_referenceView2];
        
        _targetView1 = [[UIView alloc] init];
        _targetView1.backgroundColor = [UIColor greenColor];
        [self addSubview:_targetView1];
        
        _targetView2 = [[UIView alloc] init];
        _targetView2.backgroundColor = [UIColor redColor];
        [self addSubview:_targetView2];
    }
    return self;
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    
    _referenceView1.frame = CGRectMake(10, 0, 5, self.frame.size.height);
    _referenceView2.frame = CGRectMake(self.frame.size.width - 10, 0, 5, self.frame.size.height);
    _targetView1.frame = CGRectMake(10, 10, 5, self.frame.size.height - 20);
    _targetView2.frame = CGRectMake(self.frame.size.width - 10, 10, 5, self.frame.size.height - 20);
}

#pragma mark - touch

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
}

- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
{
}

- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
{
}

@end
